<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>grid布局</title>
    <style>
        .container{
            display: grid;
            width: 800px;
            height: 500px;
            border: 1px solid blue;
            grid-template-columns: 100px 100px 100px;
            grid-template-rows: 100px 100px 100px;
            /* 纵向排列 */
            /* grid-auto-flow: column; */
            /* 针对容器的居中 */
            /* justify-items: center;
            align-items: center; */
            grid-auto-columns: 80px;
        }
        .item{
            border: 1px solid red;
        }
        .first{
            justify-content: center;
            align-content: center;
        } 
    </style>
</head>
<body>
    <div class="container">
        <div class="item first">1</div>
        <div class="item">2</div>
        <div class="item">3</div>
        <div class="item">4</div>
        <div class="item">5</div>
        <div class="item">6</div>
        <div class="item">7</div>
        <div class="item">8</div>
        <div class="item">9</div>
    </div>
</body>
</html>